home *** CD-ROM | disk | FTP | other *** search
/ Medabots Cardz / Medabots CD Cardz Sumilidon.bin / mac / assets / sumilidon.dxr / 00016_Script_16 < prev    next >
Text File  |  2001-12-07  |  2KB  |  76 lines

  1. property mysprite, dx, dy, direction, coldbusted, pSpeed, counter, animate
  2. global scorez, hit, placex, missed, randomvalue
  3.  
  4. on beginsprite me
  5.   direction = "up"
  6.   pSpeed = 10
  7.   set mysprite to the spritenum of me
  8.   set dx to the locH of sprite mysprite
  9.   set dy to the locV of sprite mysprite
  10.   coldbusted = 1
  11.   counter = 0
  12. end
  13.  
  14. on exitframe me
  15.   
  16.   if coldbusted = 1 then
  17.     
  18.     if animate = 1 then
  19.       if counter < 1 then
  20.         set the member of sprite mysprite to "meda22"
  21.         counter = counter + 1
  22.       else
  23.         counter = 0
  24.         animate = 2
  25.         
  26.       end if
  27.     else if animate = 2 then
  28.       if counter < 1 then
  29.         set the member of sprite mysprite to "meda23"
  30.         counter = counter + 1
  31.       else
  32.         animate = 0
  33.         counter = 0
  34.         set the locH of sprite mysprite = -200
  35.         set the member of sprite mysprite to "meda21"
  36.       end if
  37.     end if
  38.     if random(randomvalue) = randomvalue then
  39.       coldbusted = 2
  40.         end if
  41.     
  42.   else if coldbusted = 2 then
  43.     pSpeed = 5*random(3)
  44.     set the locV of sprite mysprite to dy
  45.     set the locH of sprite mysprite to dx
  46.     direction = "up"
  47.     coldbusted = 0
  48.   else
  49.     
  50.     if direction = "up" then
  51.       set the locV of sprite mysprite to the locV of sprite mysprite - pSpeed
  52.       if the locV of sprite mysprite < dy-150 then 
  53.         direction = "down"
  54.       end if
  55.     else
  56.       set the locV of sprite mysprite to the locV of sprite mysprite + pSpeed
  57.       if the locV of sprite mysprite > dy then 
  58.         direction = "up"
  59.         missed = missed + 1
  60.         coldbusted = 1
  61.       end if
  62.     end if
  63.   end if
  64. end
  65.  
  66.  
  67. on mouseDown me
  68.   if coldbusted = 0 then
  69.     puppetsound "explosion"
  70.     hit = 1
  71.     animate = 1
  72.     coldbusted = 1
  73.     placex = the mouseLoc
  74.     scorez = scorez + 1
  75.   end if
  76. end